<template>
  <div>
    <p v-for="i in ziyuan" :key="i.id">
      <router-link :to="{path:i.url}">{{i.name}}</router-link>

    </p>

  </div>

</template>

<script>
import axios from 'axios'

export default {
  name: "index",
  data() {
    return {
      userid: localStorage.getItem('userid'),
      ziyuan: []
    }
  },
  methods: {
    get_ziyuan() {
      axios.get('http://localhost:5000/login?userid=' + this.userid).then(res => {
        this.ziyuan = res.data.list
      })
    }
  },
  mounted() {
    this.get_ziyuan()
  }
}
</script>

<style scoped>

</style>